package com.aweqy.porcelain.service.impl;

import com.aweqy.porcelain.entity.Dynasty;
import com.aweqy.porcelain.mapper.DynastyMapper;
import com.aweqy.porcelain.service.DynastyService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 朝代信息Service实现类
 */
@Service
public class DynastyServiceImpl extends ServiceImpl<DynastyMapper, Dynasty> implements DynastyService {
    
    @Override
    public List<Dynasty> getAllDynastiesOrdered() {
        QueryWrapper<Dynasty> queryWrapper = new QueryWrapper<>();
        queryWrapper.orderByAsc("start_year");
        return this.list(queryWrapper);
    }
    
    @Override
    public Dynasty getDynastyById(Integer dynastyId) {
        return this.getById(dynastyId);
    }
} 